package com.yunshang.shoppingmall.mapper.Finace;

import com.yunshang.shoppingmall.entity.Finace.Finace;
import com.yunshang.shoppingmall.entity.FinaceToData;
import com.yunshang.shoppingmall.entity.OrderToData;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface FinaceMapper {
    int deleteByPrimaryKey(Integer financeId);

    int insert(Finace record);

    int insertFinace(@Param("classify")Integer classify, @Param("amount")BigDecimal amount, @Param("userId")Integer userId, @Param("remark")String remark, @Param("UID")Integer UID, @Param("AID")Integer AID, @Param("finaceType")Integer finaceType);

    int insertSelective(Finace record);

    Finace selectByPrimaryKey(Integer financeId);

    int updateByPrimaryKeySelective(Finace record);

    int updateByPrimaryKey(Finace record);

    //查询所有的会员编号
    List<Finace> selectFinaceList(Integer classify);

    //查询所有的会员编号
    List<Finace> selectFinaceListUserNo(@Param("classify")Integer classify, @Param("userNo")String userNo);

    //查询编号的余额
    BigDecimal selectByPrimaryUserId(@Param("classify")int classify,@Param("userId")int  userId);

    // 所以账户余额
    Finace selectFinaceAll(Integer userId);

    //查询编号的积分根据用户ID
    Finace selectFinaceByUserId(@Param("userId") int userId);


    //根据用户ID查询用户积分明细
    List<Finace> selectFinaceDetailsByUserId(FinaceToData finaceToData);

    int updateBalanceByUserId(Finace finace);

    List<Finace> selectFinaceListUserNoId(OrderToData orderToData);
    //添加财务信息
    int insertFinaceData(FinaceToData finaceToData);

    //查询积分表用户的分享赚
    List<Finace> selectFinaceByUserIdAndFinaceType(OrderToData orderToData);

    int insertFinaceTotalAdd(@Param("classify")Integer classify, @Param("amount")BigDecimal amount, @Param("userId")Integer userId, @Param("remark")String remark, @Param("UID")Integer UID, @Param("AID")Integer AID, @Param("finaceType")Integer finaceType);

    int insertFinaceTotalSet(@Param("classify")Integer classify, @Param("amount")BigDecimal amount, @Param("userId")Integer userId, @Param("remark")String remark, @Param("UID")Integer UID, @Param("AID")Integer AID, @Param("finaceType")Integer finaceType);


}